using System;
using NUnit.Framework;
using PropertyExpression.Common;
using PropertyExpression.ControllableQuery.Toolkit;

namespace ConsoleApplication1
{
    [TestFixture]
    public class QueryTest
    {
        [Test]
        public void CheckAllQueries()
        {
            var qRepository = new FindUsagesQRepository();
            QueryChecker.CheckAllQueries(
                QExecutor.ConnectionString,
                GetType().Assembly,
                (type, context) => {
                    throw new ApplicationException(
                        string.Format("There are no rules to create instances of '{0}' type.", type));
                },
                qRepository);
            qRepository.FindUsages(QExecutor.ConnectionString, Guid.NewGuid().ToString(), Option.Nothing<string>());
        }
    }
}